import {http} from "@/service/http";

const prefix = '/Transaction'

/**
 * 删除事务
 * @param id
 * @returns
 */
export const removeTransaction = (id: string) => {
  return http({
    method: 'DELETE',
    url: `${prefix}/Delete/${id}`,
  })
}


/**
 * getTranPropagation
 * @param id
 * @returns
 */
export const getTranPropagation = (id: string | number) => {
  return http<string[]>({
    method: 'GET',
    url: `${prefix}/GET`,
  })
}


/**
 * getTranPropagationById
 * @param id
 * @returns
 */
export const getTranPropagationById = (id: string | number) => {
  return http({
    method: 'GET',
    url: `${prefix}/GET/${id}`,
  })
}

/**
 * getTestTranPropagation
 * @returns
 */
export const getTestTranPropagation = () => {
  return http({
    method: 'GET',
    url: `${prefix}/GetTestTranPropagation`,
  })
}


/**
 * getTestTranPropagationNoTran
 * @returns
 */
export const getTestTranPropagationNoTran = () => {
  return http({
    method: 'GET',
    url: `${prefix}/GetTestTranPropagationNoTran`,
  })
}


/**
 * createTransaction
 * @returns
 */
export const createTransaction = () => {
  return http({
    method: 'POST',
    url: `${prefix}/Post`,
  })
}

/**
 * 获取实体 需要指定表明和链接ID
 * @param id
 * @returns
 */
export const updateTransaction = (id: string | number) => {
  return http({
    method: 'Put',
    url: `${prefix}/Put/${id}`,
  })
}
